home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Java / SlideShow / Source Clippings / Controller / Controller Action Management / Controller Action Management.rsrc / TEXT_256.txt < prev   
Encoding:
Text File  |  2000-09-28  |  840 b   |  29 lines

  1.     /**
  2.      * Adds the specified action listener to receive action events.
  3.      * @param l the action listener
  4.      */
  5.     public void addActionListener(ActionListener l)
  6.     {
  7.         actionListener = AWTEventMulticaster.add(actionListener, l);
  8.     }
  9.  
  10.     /**
  11.      * Removes the specified action listener so it no longer receives
  12.      * action events from this component.
  13.      * @param l the action listener
  14.      */
  15.     public void removeActionListener(ActionListener l)
  16.     {
  17.         actionListener = AWTEventMulticaster.remove(actionListener, l);
  18.     }
  19.     
  20.     /**
  21.      * Fire an action event to the listeners.
  22.      * @param command, the command String to send with the ActionEvent
  23.      */
  24.     protected void fireActionEvent(String command)
  25.     {
  26.         if (actionListener != null)
  27.             actionListener.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, command));
  28.     }
  29.